package com.seeyon.apps.brwh.customFieldCtrl;

import java.util.List;

import com.seeyon.cap4.form.bean.ParamDefinition;
import com.seeyon.cap4.form.bean.fieldCtrl.FormFieldCustomCtrl;
import com.seeyon.cap4.form.util.Enums;
import com.seeyon.cap4.form.util.Enums.ButtonType;

public class BindUrlControl extends FormFieldCustomCtrl{
	
	@Override
	public String getKey() {
		return "5840803754745916733";
	}
	
	@Override
	public String getFieldLength() {
		return "255";
	}
	
	//移动端文件资源
	@Override
	public String getMBInjectionInfo() {
	  return "{path:'http://bindurlcontrol.v5.cmp/v1.0.0/',weixinpath:'bindurlcontrol',jsUri:'js/bindUrlControl.js',initMethod:'init',nameSpace:'field_"+ this.getKey() +"'}"; 
	}
	//PC端文件资源
	@Override
	public String getPCInjectionInfo() {
        return "{path:'apps_res/cap/customCtrlResources/bindUrlControl/',jsUri:'js/bindUrlControl.js',initMethod:'init',nameSpace:'field_" + this.getKey() + "'}";
	}

	@Override
	public boolean canInSubTable() {
		return true;
	}
	
	@Override
	public void init() {
		this.setPluginId("bindUrlControl");//控件所属插件id
	    this.setIcon("cap-icon-e-invoice");//控件在表单编辑器中的图标
	    ParamDefinition eivoiceDef = new ParamDefinition();//控件属性设置定义对象
	    eivoiceDef.setDialogUrl("apps_res/cap/customCtrlResources/bindUrlControl/html/setField.html");
	    eivoiceDef.setDisplay("绑定链接字段");//如果要做国际化 这个地方只能存key
	    eivoiceDef.setDialogTitle("绑定链接字段");
	    eivoiceDef.setName("bindUrlField");//控件属性名
	    eivoiceDef.setParamType(Enums.ParamType.button);//控件属性类型
	    addDefinition(eivoiceDef);
	}
	
	@Override
	public boolean isButton() {
		return true;
	}

	@Override
	public boolean canBathUpdate() {
		return false;
	}

	@Override
	public String[] getDefaultVal(String arg0) {
		return null;
	}

	

	@Override
	public ButtonType getButtonType() {
		return ButtonType.CustomBtn;
	}

	@Override
	public List<String[]> getListShowDefaultVal(Integer arg0) {
		return null;
	}

	@Override
	public String getText() {
		return "链接绑定";
	}

}
